#include<iostream>
using namespace std;
int main()
{
	long x,y,z;
	cin>>x>>y;
	if(y%x==0)
	 z=y+x;
	else
 	 z=y-x;
 	cout<<z;
 	return 0;
}
